<?php
require("config.php");
$page = intval($_GET['page']);
if(empty($page)) {$page = 0;}
$pagestart = $page * 30;
$pageend = ( $page + 1 ) * 30;
$exec = "SELECT * FROM p8_case_software LIMIT $pagestart , $pageend";
$rs = mysql_query($exec);	
echo mysql_error();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>下载页面</title>
<style>
* {
margin:0;
padding:0;
}
.onearray {
clear:both;
margin:2px 10%;
font-size:14px;
line-height:18px;
}
.bool {
float:left;
width:50px;
}
.team {
float:left;
width:40em;
}
.name {
float:left;
width:5em;
}
.download {
float:left;
width:5em;
}
</style>
</head>

<body>
<div style="text-align:center">
<?php
if($page!=0) {
	$pre = $page - 1;
	echo "<a href=\"list.php?page=".$pre."\">上一页</a>&nbsp;";
}
if($page<4) {
	$next = $page +1;
	echo "&nbsp;<a href=\"list.php?page=".$next."\">下一页</a>";
}
?>
</div>
<?php
while($result = mysql_fetch_object($rs)) {
?>
<div class="onearray">
    <div class="bool"><?php if($result->down) {echo '<span style="color:blue;">已下载';} else {echo '<span style="color:red;">未下载';}?></span></div>
	<div class="team"><?php echo iconv('latin1', 'utf-8', $result->title);?></div>
	<div class="name"><?php echo $result->fname;?></div>
	<div class="posttime"><?php echo $result->posttime;?></div>
    <div class="download"><a href="http://www.content.org.cn/summerpractise/attachment.php?id=<?php echo $result->id;?>" target="_blank">点我下载</a></div>
</div>
<?php
}
?>
</body>
</html>